﻿function show() {
    var d = document.getElementById("divRetrieve");
    d.style.display = "block";
    var s = document.getElementById("sad");
    s.style.display = "block";
    var b = document.getElementById("sadBody");
    b.style.display = "none";
};
function hid() {
    var d = document.getElementById("divRetrieve");
    d.style.display = "none";
    var s = document.getElementById("sad");
    s.style.display = "none";
    var b = document.getElementById("sadBody");
    b.style.display = "block";
}
var prevColor = "";
function changeColor(trObj) {
    prevColor = trObj.style.backgroundColor;
    trObj.style.backgroundColor = "#CAE8EA";
};
function changeBCColor(trObj) {
    trObj.style.backgroundColor = prevColor;
};
var timmer;
function hide() {
    $("#message").fadeOut("slow");
    //定时器也同时关闭
    clearInterval(timmer);
};

//不停地发送ajax请求看看有没有新的留言
function getMessage() {
    var m= document.getElementById("message");
    m.style.display = "none";
    var uid = 0;
    $.post("getMessageCount.ashx", { "uid": uid }, function (data) {
        if (data != "no") {
            var m2 = document.getElementById("message");
            m2.style.display = "block";
            var a = document.getElementById("messagelink");
            a.innerHTML = "您有" + data + "条留言,点击查看";
           
        }
        else {
            var m3 = document.getElementById("message");
            m3.style.display = "none";
        }
    });
};

function getMessage2() {
    //利用定时器
    timmer = setInterval("getMessage()",0);
};